<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="laborc" uri="/laborc-tags"%>
<table id="user_table">
	<s:if test="total!=0">
		<s:if test='sign==0'>
			<th class="user_table_1">
				学号
			</th>
		</s:if>
		<s:else>
			<th class="user_table_1">
				教工号
			</th>
		</s:else>
		<th class="user_table_2">
			姓名
		</th>
		<s:if test='sign==0'>
			<th class="user_table_3">
				专业
			</th>
		</s:if>
		<s:else>
			<th class="user_table_3">
				研究所
			</th>
		</s:else>
		<th class="user_table_4">
			手机
		</th>
		<th class="user_table_5">
			邮箱
		</th>
		<th class="user_table_6">
			操作
		</th>
		
		<s:iterator value="listUser" id="user" status="userSate">
			<tr>
				<s:if test='sign==0'>
					<td>
						<a href="javascript:void(0)"
								onclick="showStudent('${user.studentNum }')">${user.studentNum }</a>
					</td>
				</s:if>
				<s:else>
					<td>
						<a href="javascript:void(0)"
								onclick="showTeacher('${user.teacherNum }')">${user.teacherNum }</a>
					</td>
				</s:else>
				<td>
					${user.name }
				</td>
				<s:if test='sign==0'>
					<td>
						${user.professional.professionalName }
					</td>
				</s:if>
				<s:else>
					<td>
						${user.institute.instituteName }
					</td>
				</s:else>
				<td>${user.telephone}</td>
				<td>${user.email }</td>
				<s:url id="deleteStudent" action="laborc/deleteStudent">
					<s:param name="num" value="%{#user.studentNum }"></s:param>
				</s:url>
				<s:url id="deleteTeacher" action="laborc/deleteTeacher">
					<s:param name="num" value="%{#user.teacherNum }"></s:param>
				</s:url>
				<s:if test='sign==0'>
					<td>
						<s:a href="%{deleteStudent}" theme="ajax" targets="deleteResult"  loadingText="删除中...">
						删除
						</s:a>
					</td>
				</s:if>
				<s:else>
					<td>
						<s:a href="%{deleteTeacher}" theme="ajax" targets="deleteResult" loadingText="删除中...">
						删除
						</s:a>
					</td>
				</s:else>
			</tr>
		</s:iterator>
		<tr>
			<td colspan="5" style="text-align: right;">
				<s:if test='sign==0'>
					<laborc:page cpage="%{cpage}" total="%{total}" url="%{url}" dojoType="struts:BindAnchor" targets="student_container"/>
				</s:if>
				<s:else>
					<laborc:page cpage="%{cpage}" total="%{total}" url="%{url}" dojoType="struts:BindAnchor" targets="teacher_container"/>
				</s:else>
			</td>
		</tr>
	</s:if>
	<s:else>
		<tr>
			<td>
				暂无数据
			</td>
		</tr>
	</s:else>
</table>
